<?php if(false) {?>
<link rel="stylesheet" rev="stylesheet" href="../../../images/admincp/style.css" type="text/css" media="all" />
<?php }?>
<?php include $this->header();?>
<form method="post" enctype="application/x-www-form-urlencoded" onsubmit="return Validator.Validate(this)">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="rank mt bd p1 ">
    <tr class="th">
        <td colspan="3">&nbsp;<?=$act?></td>
    </tr>
    <tr>
        <td width="125" align="right">配置项名称</td>
        <td width="320"><input type="text" name="option_title" size="48" id="option_title" class="text-box" value="<?=$optionAttr['option_title']?>" datatype="Require" msg="请输入配置项名称" onblur="return Validator.check(this)" /></td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td align="right">配置项标识</td>
        <td width="320"><input type="text" name="option_name" size="48" id="option_name" class="text-box" value="<?=$optionAttr['option_name']?>" datatype="Require" msg="请输入配置项标识" onblur="return Validator.check(this)" /></td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td align="right">配置项类型</td>
        <td>
            <select onchange="return Validator.check(this)" id="option_type" msg="请选择配置项类型" datatype="Require" name="option_type" class="">
            <option value="">请选择</option>
		    <?php foreach($optionTyps as $optionTyp) {?>
            <option value="<?=$optionTyp['option_type']?>" <?php if($optionAttr['option_type']==$optionTyp['option_type']){?>selected="selected"<?php }?> ><?=$optionTyp['option_type_name']?></option>
            <?php }?>
            </select>
        </td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td align="right">输入框类型</td>
        <td>
            <div id="option_input_type">
                <input type="radio" <?php if($optionAttr['option_input_type']=='text'){?>checked="checked"<?php }?> onclick="option_values_disable()" value="text" name="option_input_type" class="">单行文本
                <input type="radio" <?php if($optionAttr['option_input_type']=='textarea'){?>checked="checked"<?php }?> onclick="option_values_disable()" value="textarea" name="option_input_type">多行文本
                <br>
                <input type="radio" <?php if($optionAttr['option_input_type']=='select'){?>checked="checked"<?php }?> onclick="option_values_active()" value="select" name="option_input_type" class="">下拉菜单
                 <input type="radio" <?php if($optionAttr['option_input_type']=='radio'){?>checked="checked"<?php }?> onclick="option_values_active()" value="radio" name="option_input_type" class="">单选框
                 <input type="radio" <?php if($optionAttr['option_input_type']=='checkbox'){?>checked="checked"<?php }?> onclick="option_values_active()" msg="必须选定输入框类型" datatype="Group" value="checkbox" name="option_input_type" class="">多选框
            </div>
        </td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td align="right">可选值列表</td>
        <td>
            <textarea rows="3" cols="45" id="option_values" name="option_values" class="" <?php if($optionAttr['option_input_type']=='text' || $optionAttr['option_input_type']=='textarea'){?>disabled="disabled"<?php }?>><?=$optionAttr['option_values']?></textarea>
        </td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td align="right">是否必填</td>
        <td>
            <select name="option_is_required" id="option_is_required">
                <option value="0" <?php if(!$optionAttr['option_is_required']){?>selected="selected"<?php } ?>>否</option>
                <option value="1" <?php if($optionAttr['option_is_required']){?>selected="selected"<?php } ?>>是</option>
            </select>
        </td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td align="right">填写错误时提示信息</td>
        <td><input type="text" size="48" value="<?=$optionAttr['option_msg']?>" id="option_msg" name="option_msg" class=""></td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td align="right">配置项排序</td>
        <td><input type="text" size="3" value="<?=$optionAttr['option_order']?>" id="option_order" name="option_order" class=""></td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td align="right">配置项说明</td>
        <td><textarea rows="3" cols="45" id="option_note" name="option_note" class=""><?=$optionAttr['option_note']?></textarea></td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td align="right">&nbsp;</td>
        <td><input type="submit" class="btn" value="确定修改" /> <input type="reset" class="btn" value="重置表单" /></td>
        <td>&nbsp;</td>
    </tr>
</table>
</form>

<script type="text/javascript">
// <![CDATA[
function option_values_active() {
	$('#option_values').attr('disabled', '');
	$('#option_values').attr('dataType', 'Require');
	$('#option_values').attr('onblur', 'return Validator.check(this)');
	$('#option_values').attr('msg', '请设置提供选择的值');
}

function option_values_disable() {
	$('#option_values').attr('disabled', 'disabled');
	$('#option_values').attr('dataType', '');
	$('#option_values').attr('msg', '');
}
// ]]>
</script>
<?php include $this->footer();?>
